class CreateThreadMessages < ActiveRecord::Migration
  def self.up
    create_table :messages do |t|
      t.integer :sender_id
      t.string  :receiver_ids
      t.string  :subject
      t.text    :body
      t.integer :thread_id

      t.timestamps
    end
    
    create_table :box_items do |t|
      t.string    :type
      t.integer   :user_id
      t.integer   :message_id
      t.integer   :thread_id
      t.timestamp :read_at
      t.boolean   :inbox_deleted, :outbox_deleted
      t.timestamps
    end
  end

  def self.down
    drop_table :messages
    drop_table :box_items
  end
end
